package org.jeecg.moudles.inventory.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.moudles.inventory.mapper.DamageMapper;
import org.jeecg.moudles.inventory.entity.Damage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @description:
 * @company: yaorange
 * @author: Ruka
 * @version: 1.0
 * @create: 2022-04-26 16:58
 */
@Service
public class DamageService {

    @Resource
    private DamageMapper damageMapper;


    public Page<Damage> page(Integer pageNUm, Integer pageSize, Integer category) {

        Page<Damage> page = new Page<>(pageNUm, pageSize);
        if (category ==null){
            return damageMapper.selectPage(page,null);
        }

        return damageMapper.selectPage(page,new QueryWrapper<Damage>().eq("goods_type_id",category));
    }
}
